<template>
  <view class="demo-container">
    <!-- 基础用法 -->
    <view class="demo-block">
      <view class="demo-block__title">基础用法</view>
      <view class="demo-block__content">
        <fu-badge :value="5">
          <view class="demo-box"></view>
        </fu-badge>
        <fu-badge :value="10">
          <view class="demo-box"></view>
        </fu-badge>
        <fu-badge value="Hot">
          <view class="demo-box"></view>
        </fu-badge>
        <fu-badge dot>
          <view class="demo-box"></view>
        </fu-badge>
      </view>
    </view>
    
    <!-- 最大值 -->
    <view class="demo-block">
      <view class="demo-block__title">最大值</view>
      <view class="demo-block__content">
        <fu-badge :value="200" :max="99">
          <view class="demo-box"></view>
        </fu-badge>
      </view>
    </view>
    
    <!-- 自定义颜色 -->
    <view class="demo-block">
      <view class="demo-block__title">自定义颜色</view>
      <view class="demo-block__content">
        <fu-badge :value="5" type="primary">
          <view class="demo-box"></view>
        </fu-badge>
        <fu-badge :value="10" type="success">
          <view class="demo-box"></view>
        </fu-badge>
        <fu-badge :value="20" type="warning">
          <view class="demo-box"></view>
        </fu-badge>
        <fu-badge :value="30" type="info">
          <view class="demo-box"></view>
        </fu-badge>
        <fu-badge :value="40" color="#8f2d56">
          <view class="demo-box"></view>
        </fu-badge>
      </view>
    </view>
    
    <!-- 自定义位置 -->
    <view class="demo-block">
      <view class="demo-block__title">自定义位置</view>
      <view class="demo-block__content">
        <fu-badge :value="10" :offset="[10, 10]">
          <view class="demo-box"></view>
        </fu-badge>
      </view>
    </view>
    
    <!-- 独立展示 -->
    <view class="demo-block">
      <view class="demo-block__title">独立展示</view>
      <view class="demo-block__content">
        <fu-badge :value="20" />
        <fu-badge value="New" type="primary" />
        <fu-badge dot type="success" />
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {}
  }
}
</script>

<style lang="scss" scoped>
.demo-container {
  padding: 20rpx;
}

.demo-block {
  margin-bottom: 30rpx;
  
  &__title {
    margin-bottom: 20rpx;
    font-size: var(--fu-font-size-lg);
    color: var(--fu-text-color);
  }
  
  &__content {
    background-color: #fff;
    border-radius: var(--fu-radius-base);
    padding: 30rpx;
    display: flex;
    align-items: center;
    gap: 30rpx;
  }
}

.demo-box {
  width: 80rpx;
  height: 80rpx;
  background-color: #f5f5f5;
  border-radius: var(--fu-radius-base);
}
</style> 